<!-- 目录 -->
<div class="asset-breadcrumb-title">
  <ol class="asset-breadcrumb">
    <li><a href="{{path('asset_show')}}">{{'%asset_name%'|trans({'%asset_name%': setting('asset.name')|default('素材频道'|trans)})}}</a></li>
    {% for breadcrumb in breadcrumbs %}
      <li><a href="{{path('asset_category',{categoryCode:breadcrumb.code})}}">{{breadcrumb.name}}</a></li>
    {% endfor %}
    <li class="active asset-location">{{'正文'|trans}}</li>
  </ol>
</div>
<!-- banner -->
<div class="swiper-container asset-swiper-container1">
    <div class="swiper-wrapper asset-swiper-wrapper">
        {% if asset.picthumb.imgs %}

           {% for key,pic in asset.picthumb.imgs %}
           {% if pic.type=='img' %}
                <div class="swiper-slide asset-swiper-slide" style="background-image:url({{ pic.src }})"></div>
           {% endif %}
           {% if pic.type=='video' %}
               <div class="swiper-slide asset-swiper-slide">
                   <video loop="loop" style="width:100%;height:100%" controls="controls" class="asset-video" id="assetvideo-{{ key }}">
                       <source  src="{{ pic.src }}" type="video/mp4" >
                   </video>

               </div>
            {% endif %}
            {% if pic.type=='iframe' %}
                <div class="swiper-slide asset-swiper-slide">
                    <iframe frameborder="0" scrolling="no" width="100%" height="100%" src="{{ pic.src }}"></iframe>
                </div>
             {% endif %}
          {% endfor %}

        {% else %}
        <div class="swiper-slide asset-swiper-slide" style="background-image:url(../../../../../../assets/img/common/article_top_img.png)"></div>

        {% endif %}
    </div>

    <div class="swiper-button-next asset-swiper-button-next"></div>
    <div class="swiper-button-prev asset-swiper-button-prev"></div>
</div>

<div class="asset-preview">
  <div class="swiper-button-prev swiper-sub-prev"></div>


  <div class="swiper-container asset-gallery-thumbs" {% if asset.picthumb %} {% if asset.picthumb.imgs|length < 4 %} style="justify-content:center;" {% endif %} {% endif %}>
      <div class="swiper-wrapper asset-swiper-wrapper">

          {% if asset.picthumb.imgs %}

            {% for pic in asset.picthumb.imgs %}
               {% if pic.type=='img' %}
                <div class="swiper-slide asset-swiper-slide">
                    <div class="asset-swiper-slide-img" style="background-image:url({{ pic.src }})">

                    </div>

                </div>
               {% endif %}
               {% if pic.type=='video' %}
               <div class="swiper-slide asset-swiper-slide">
                   <div class="asset-swiper-slide-img" style="background-image:url(../../../../../../assets/img/common/video_asset_img.png)">

                   </div>
               </div>
               {% endif %}
               {% if pic.type=='iframe' %}
               <div class="swiper-slide asset-swiper-slide">
                   <div class="asset-swiper-slide-img" style="background-image:url(../../../../../../assets/img/common/3dmodel_asset_img.jpeg)">

                   </div>
               </div>
               {% endif %}
            {% endfor %}

          {% else %}
          <div class="swiper-slide asset-swiper-slide">
              <div class="asset-swiper-slide-img" style="background-image:url(../../../../../../assets/img/common/article_top_img.png)">

              </div>

          </div>


          {% endif %}
      </div>

  </div>
  <div class="swiper-button-next swiper-sub-next"></div>

</div>


<div class="asset-descrition">
  <div class="asset-aritical-title">

    <p>{{ asset.title }}</p>
    <a href="javascript:;" class="love js-asset-like {% if userLike %}color-primary{% endif %}" data-like-url="{{ path('asset_like', {assetId:asset.id}) }}" data-cancel-like-url="{{ path('asset_cancel_like', {assetId:asset.id}) }}">
    {% if userLike.id %}
    <button class="status active" style="background:grey">已收藏</button>
    {% else %}
    <button class="status">收  藏</button>
    {% endif %}
    </a>

  </div>
  <div class="asset-file-time">
    <div class="asset-file-size">
      <span>大小：</span>
      <span>{{ asset.size }}</span>
    </div>
    <div class="asset-desc-date">
      <span class="asset-data-tittle">时间：</span></span>
      <span class="asset-year"> 20{{ asset.publishedTime|date('y') }}年</span>
      <span class="asset-month">{{'%publishedTime%月'|trans({'%publishedTime%': asset.publishedTime|date('m')}) }}</span>
      <span class="asset-day">{{ asset.publishedTime|date('d') }}日</span>
    </div>
  </div>
  <div class="asset-desc">
  <style>
  .asset-desc img{ display:none;}
  .asset-desc p{
      display: none;
  }
  </style>
  {{ asset.body |raw }}
  </div>
</div>




<!-- <div class="asset-metas">
  <div class="pull-left">
    <div class="date">
      <div class="day">{{ asset.publishedTime|date('d') }}</div>
      <div class="month">{{'%publishedTime%月'|trans({'%publishedTime%': asset.publishedTime|date('m')}) }}</div>
    </div>
  </div>
  <div class="metas-body">
    <h2 class="title">
      {{ asset.title }}
    </h2>
    <div class="sns">
      <span class="views-num">
        <i class="es-icon es-icon-visibility"></i>{{ asset.hits }}
      </span>
      <span class="comment-num">
        <i class="es-icon es-icon-textsms"></i>{{ asset.postNum }}
      </span>
      <span class="love-num">
        <i class="es-icon es-icon-favorite"></i><span class="js-like-num">{{ asset.upsNum }}</span>
      </span>
    </div>
  </div>
</div> -->
<script
  src="https://code.jquery.com/jquery-1.12.4.min.js"
  integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
  crossorigin="anonymous"></script>
<script src="https://cdn.bootcss.com/Swiper/2.7.6/idangerous.swiper.js"></script>
